/**
 * 文章评论
 */
function ajaxClick(type){
					$.ajax({
					type:'POST',
					url:'expose/article/view',
					data:{'id':$('#articleId').val(),'type':type},
					dataType:'json',
					 success:function(data){
								if(data && data.success){
									showAlertDiv(data.message);
									switch(type){
										case 1:
											$(".articleDetail .zhichi span").html("("+data.object.supportNum+")");
											break;
										case 2:
											$(".articleDetail .fandui span").html("("+data.object.opposeNum+")");
										break;
										case 3:
											$(".articleDetail .collect span").html("("+data.object.collectNum+")");
										break;
									}
									}else if(data.code == 102){
										showDiv(data.message);
									}else{
										showAlertDiv(data.message);
									}
							}
				});
		}
			
		function ajaxComment(){
			var world = $('#world').html();
			if(world == "" || world =='来说两句吧...'){
				$('#world').html('');
				showAlertDiv('评论不能为空,请发表一下的你的看法!');
				return;
			}else{
					var chName = $('#currentChName').val();
					$.ajax({
					type:'POST',
					url:'expose/article/articleComment',
					data:{'articleId':$('#articleId').val(),'commentContent':$(".pinglun-content").html()},
					dataType:'json',
					 success:function(data){
								if(data && data.success){
									showAlertDiv(data.message);
										var cLi = "<li><div style=\"float: left;width: 80px;height: 70px;\"><img style=\"border-radius:50%;width: 65px;height: 65px;\" src=\"expose/article/showPicture/"+data.object.userId+"\" /></div><div class=\"pinglun-date\">"+chName+":&nbsp;&nbsp;"+formatDateStyle(data.object.commentDate)+"</div><div class=\"pinglun-comment\">"+data.object.commentContent+"</div></li>";
										$(".pinglun-list ul").prepend(cLi);
								}else if(data.code == 100){
									showDiv(data.message);
								}else{
									showAlertDiv(data.message);
								}
						}
				});
			}
			}
			
	function doZoom(size) {
			document.getElementById('zoom').style.fontSize = size+ 'px';
	}
	
	/**
	 * 关注文章作者
	 */
function attentionArticleAuth(){
	$.ajax({
		type:'POST',
		url:'expose/article/attentionArticleAuth',
		data:{'userId':$('#authId').val()},
		dataType:'json',
		 success:function(data){
					if(data && data.success){
							showAlertDiv(data.message);
					}else if(data.code == 102){
							showDiv(data.message);
					}else{
							showAlertDiv(data.message);
					}
				}
	});
}

/**
 * 发私信
 */
function sendPrivateMsg(){
	$.ajax({
		type:'POST',
		url:'expose/article/sendPrivateMsg',
		data:{'userId':$('#authId').val()},
		dataType:'json',
		success:function(data){
			if(data && data.success){
				window.location.href='user/notifications/personalLetter?userId='+$('#authId').val();
			}else{
				showDiv(data.message);
			}
		}
	});
}

	